package test.test1202;

import java.util.Scanner;

public class test05 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个小数：");
        double a = sc.nextDouble();
        double k = absolute(a);
        System.out.println("这个小数的绝对值是：" + k);
    }

    public static double absolute(double a) {
        return a >= 0 ? a : -a;
    }
}
